package java3_16.Pet;

/**
 *6：用oop描述宠物系统，宠物有 狗，猫和鹦鹉。
 *宠物都有名字，品种，体重的属性，有吃和睡 和自我介绍的方法。。。
 *狗还有抓老鼠的方法，猫有爬树的方法，鹦鹉有飞行的方法。
 *用继承描述这个现象
 */
//父类  宠物类
public class Pet {
    private String name;
    private String type;
    private String weight;

    public Pet(){

    }
    public Pet(String name,String type,String weight){
        this.name = name;
        this.type = type;
        this.weight = weight;
    }
    public void introduce(){
        System.out.println("我叫:"+name);
        System.out.println("我是一只:"+type);
        System.out.println("我的体重是:"+weight);
    }
    public void eat(){
        System.out.println(type+"在吃饭");
    }
    public void sleep(){
        System.out.println(type+"在睡觉");
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }
}
